<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="description" content="">
    <meta name="author" content="">
	
    <title>注册页面</title>
	
    <!-- Bootstrap Core CSS -->
    <link rel="stylesheet" href="/index/css/bootstrap.min.css"  type="text/css">
	
	<!-- Custom CSS -->
    <link rel="stylesheet" href="/index/css/style.css">
	<link rel="stylesheet" href="/index/css/org.css">
	
	<!-- Custom Fonts -->
    <link rel="stylesheet" href="/index/font-awesome/css/font-awesome.min.css"  type="text/css">
    <link rel="stylesheet" href="/index/fonts/font-slider.css" type="text/css">
	
	<!-- jQuery and Modernizr-->
	<script src="/index/js/jquery-2.1.1.js"></script>
	<script type="text/javascript" src="index/jQuery-1.11.3.min.js"></script>
	<!-- Core JavaScript Files -->  	 
    <script src="/index/js/bootstrap.min.js"></script>
</head>

<body>
	<!--头部登录注册使用layout.html模板布局-->
 
	<!--注册界面-->
	<div id="page-content" class="single-page1">
		<div class="container">	
			<div class="row">		
        		<div class="col-md-61">
					<div class="heading" style="font-size:28px;">注册新用户</div>
					<form method="post" action="regCheck">
						<div class="form-group">
							<input type="text" class="form-control" placeholder="用户名(注册后无法修改)" name="username" id="firstname" required><span class="form-ajax"></span>
						</div>
						<!-- <div class="form-group">
							<input type="text" class="form-control" placeholder="邮箱" name="email" id="email" required><span class="form-ajax"></span>
						</div> -->
						<div class="form-group">
							<input type="tel" class="form-control" placeholder="请输入11位手机号码" name="phone" id="phone" required><sapn class="form-ajax"></sapn>
						</div>
						<div class="form-group">
							<input type="password" class="form-control" placeholder="密码不可为纯数字，长度6-20字符" name="password" id="password" required><sapn class="form-ajax"></sapn>
						</div>
						<div class="form-group">
							<input type="password" class="form-control" placeholder="确认密码" name="repassword" id="repassword" required><sapn class="form-ajax"></sapn>
						</div>
						<div class="form-group">
							<input type="text" class="form-control" placeholder="验证码" name="yzm" id="repassword" required><sapn class="form-ajax"></sapn>
						</div>
						<div class="form-group">
							<img id="yzm" src="{:captcha_src()}">
						</div>
						<!-- <div style="margin: 10px;">
							<input name="agree" id="agree" type="checkbox" > 我同意你的网站请求！
						</div> -->
						<input type="hidden" name="userreg">
						<button type="submit" class="btn btn-2" id="show">立即注册</button>
					</form>
				</div>
			</div>
		</div>
	</div>

   <!-- 尾部适用layout.html模板布局 -->
   	
</body>
</html>
<script type="text/javascript">
	var show = document.getElementById('show');
	show.onmouseover = function () {
	show.style.background = 'green';
};
show.onmouseout = function () {
	show.style.background = '#989CA2';
};
// 刷新验证码
var yzm = document.getElementById('yzm');
yzm.onclick = function()
{
	yzm.src = '{:captcha_src()}';
} 
</script>
<!-- Ajax注册检测 -->
<script type="text/javascript">
	// 用户名检测
	$(function(){
		$(":input[name='username']").keyup(function(){
			var val = $(this).val();
			if (val != "") {
				$.get("nameAjax",{username:val},function(data){
					$(".form-ajax:eq(0)").text(data);
				});
			}
		});
		// $(":input[name='username']").blur(function(){
		// 	var val = "";
		// 	$(".form-ajax:eq(0)").text(val);
		// });
		// 邮箱验证
		// $(":input[name='email']").keyup(function(){
		// 	var val = $(this).val();
		// 	if (val != "") {
		// 		$.get("emailAjax",{email:val},function(data){
		// 			$(".form-ajax:eq(1)").text(data);
		// 		});
		// 	}
		// });
		// 电话验证
		$(":input[name='phone']").keyup(function(){
			var val = $(this).val();
			if (val != "") {
				$.get("phoneAjax",{phone:val},function(data){
					$(".form-ajax:eq(1)").text(data);
				});
			}
		});
		// 密码检测
		$(":input[name='password']").keyup(function(){
			var val = $(this).val();
			var cfm = $(":input[name='respassword']").val();
			if (val != "") {
				$.get("pwdAjax",{pwd:val},function(data){
					$(".form-ajax:eq(2)").text(data);
				});
			}
			if (cfm != val) {
				$(".form-ajax:eq(3)").text("两次输入的密码不一致");
			}
		});
		// 确认密码是否一致
		$(":input[name='repassword']").keyup(function(){	
			var cfm = $(this).val();
			var pwd = $(":input[name='password']").val();
			if (cfm != pwd) {
				$(".form-ajax:eq(3)").text("两次输入的密码不一致");
			} else {
				$(".form-ajax:eq(3)").text("");
			}
		});
	});
</script>